package net.sakz.oss;

import java.util.concurrent.ConcurrentHashMap;

public class TokenManager {
	private ConcurrentHashMap<String, UserSSOInfo> ssoUserInfo;
	private static TokenManager instance = null;  
	static {
		instance=new TokenManager();
	}
	private TokenManager() {
		ssoUserInfo = new ConcurrentHashMap<String, UserSSOInfo>();
	}
	/**
	 * 线程安全
	 * @return
	 */
	public static TokenManager getInstance() {
		return instance;
	}
	
	public void add(String ssoSessionId, UserSSOInfo ssoUserSessionInfo) {
		ssoUserInfo.put(ssoSessionId, ssoUserSessionInfo);
	}
	
	public UserSSOInfo get(String ssoSessionId) {
		return ssoUserInfo.get(ssoSessionId);
	}
}
